package 线程.demo14;

/**
 * @author wql
 * @version 1.0
 * @date 2022/11/1 17:56
 */

public class Girl extends Thread{
    @Override
    public void run() {
        synchronized (LockDead.lock){
            System.out.println(Thread.currentThread().getName()+"得到一个筷子");
            synchronized (LockDead.lock1){
                System.out.println(Thread.currentThread().getName()+"得到另一个筷子");
                System.out.println(Thread.currentThread().getName()+"能吃了");
            }
        }
    }
}
